This invention relates to a quantizing and dequantizing circuit for use in, for example, a device that compresses and decompresses digitized image data.
Efficient recording and transmission of digitized image data demands that the data be compressed. In one standard compression method, an image is divided into, for example, eight-by-eight pixel blocks. First, each block of pixel values is converted by a discrete cosine transformation (DCT) to spatial frequency values (DCT coefficients). The transformed data are next quantized by dividing the data by a set of values representing quantization step sizes, using different step sizes for different frequencies. The quantized data are then encoded by Huffman-type variable-length encoding, in which shorter codewords are assigned to frequently-occurring data and longer codewords to infrequently-occurring data.
In decompression, this procedure is followed in reverse. Huffman decoding is used to recover the quantized data, which are next dequantized by multiplication by the same step-size values as were used in quantization. Then an inverse discrete cosine transformation (IDCT) is applied to reconstruct the pixel values.
Devices that perform image compression and decompression accordingly have a circuit that performs quantization during compression and dequantization during decompression. A conventional quantizing and dequantizing circuit comprises a memory that stores a set of step-size values, a hardware divider for dividing data by these values to quantize the data, and a hardware multiplier for multiplying data by the same values to dequantize the data.
A problem with this conventional circuit is that hardware multipliers and dividers are complex circuits that take up considerable space. To reduce the size and cost of the compression and decompression device, a smaller quantizing and dequantizing circuit design is desirable.
A constraining factor Is that while the compression procedure described above is embodied in several standards, there is no single agreed-on set of step-size values; that is, there is no single standard quantization table. To accommodate a variety of image data, the compression and decompression device needs to be able to operate with various quantization tables.